package ext.db;

import java.util.Collection;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Set;

public abstract class ModelObject implements Map<String, Object>{

	private final Map<String, Object> dbMap = new LinkedHashMap<String, Object>();
	
	//db
	private static DbHelper db = new DbHelper();
	
	public DbHelper db(){
		return db;
	}
	
	@Override
	public int size() {
		return dbMap.size();
	}

	@Override
	public boolean isEmpty() {
		return dbMap.isEmpty();
	}

	@Override
	public boolean containsKey(Object key) {
		return dbMap.containsKey(key);
	}

	@Override
	public boolean containsValue(Object value) {
		return dbMap.containsValue(value);
	}

	@Override
	public Object get(Object key) {
		return dbMap.get(key);
	}

	@Override
	public Object put(String key, Object value) {
		return dbMap.put(key, value);
	}

	@Override
	public Object remove(Object key) {
		return dbMap.remove(key);
	}

	@Override
	public void putAll(Map<? extends String, ? extends Object> m) {
		dbMap.putAll(m);
	}

	@Override
	public void clear() {
		dbMap.clear();
	}

	@Override
	public Set<String> keySet() {
		return dbMap.keySet();
	}

	@Override
	public Collection<Object> values() {
		return dbMap.values();
	}

	@Override
	public Set<java.util.Map.Entry<String, Object>> entrySet() {
		return dbMap.entrySet();
	}
	
	@Override
	public String toString() {
		return dbMap.toString();
	}
}
